#include "GameState.h"


GameState::GameState()
{}

GameState::~GameState(){
    if(mSceneManager){
        delete mSceneManager;
    }

    if(mInputManager){
        delete mInputManager;
    }

    if(mRoot){
        delete mRoot;
    }

    if(mCamera){
        delete mCamera;
    }

    if(mViewport){
        delete mViewport;
    }
}

void GameState::init()
{
    mRoot = Ogre::Root::getSingletonPtr();
    mSceneManager = mRoot->getSceneManager("MainSceneManager");
    mInputManager = InputManager::getSingletonPtr();
}

void GameState::exit()
{
    mSceneManager->clearScene();
    mSceneManager->destroyAllCameras();
}

